package com.shop.admin.service.admin;

import com.shop.admin.dao.admin.AdminActionLogDao;
import com.shop.admin.dao.admin.AdminActionLogSQLDao;
import com.shop.admin.reqeust.admin.AdminActionLogPageReq;
import com.shop.domain.admin.AdminActionLog;
import com.shop.web.response.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Transactional
@Service
@Slf4j
public class AdminActionLogService {

    @Autowired
    private AdminActionLogDao adminActionLogDao;
    @Autowired
    private AdminActionLogSQLDao adminActionLogSQLDao;

    public BaseResponse findById(Long id) {
        AdminActionLog adminActionLog = adminActionLogDao.findSingle(id);
        // 返回用户信息
        return new BaseResponse(adminActionLog);
    }


    public BaseResponse page(AdminActionLogPageReq adminActionLogPageReq) {
        return new BaseResponse(adminActionLogSQLDao.page(adminActionLogPageReq));
    }

    public BaseResponse save(AdminActionLog adminActionLog) {
        adminActionLogDao.save(adminActionLog);
        return new BaseResponse(adminActionLog);
    }

}
